Returns a value that specifies the number of seconds that have elapsed since midnight.
午前 0 時を基点とする経過時間を秒数で返します。
![]() | You must first declare a variable to call the Timer function and assign it the "Long " data type, otherwise a Date value is returned.
Timer 関数を呼び出す場合は、あらかじめ定義しておいた「ロング整数」型の変数に戻り値を返させる必要があります。そうでない場合は、時刻ではなく日付が返されます。 |
Timer
Timer
Date
日付
Sub ExampleTimer
Sub ExampleTimer
Dim lSec as long,lMin as long,lHour as long
Dim lSec as long,lMin as long,lHour as long
lSec = Timer
lSec = Timer
MsgBox lSec,0,"Seconds since midnight"
MsgBox lSec,0,"Seconds since midnight"
lMin = lSec / 60
lMin = lSec / 60
lSec = lSec Mod 60
lSec = lSec Mod 60
lHour = lMin / 60
lHour = lMin / 60
lMin = lMin Mod 60
lMin = lMin Mod 60
MsgBox Right("00" & lHour , 2) & ":"& Right("00" & lMin , 2) & ":" & Right("00" & lSec , 2) ,0,"The time is"
MsgBox Right("00" & lHour , 2) & ":"& Right("00" & lMin , 2) & ":" & Right("00" & lSec , 2) ,0, "只今の時刻 "
end sub
end sub